#!/usr/bin/python
import Image, ImageDraw

def main():
    img = Image.open('white.gif')
    newimg = Image.new('RGB', (1024,1024), color=(0,255,255))
    draw = ImageDraw.Draw(newimg)

    item = 0
    l=[(128*item,512)]
    for f in range(133):
        img.seek(f)
        im = img.load()
        for x in range(98,103):
            for y in range(98,103):
                if im[x,y] != 0:
                    print f,x,y,im[x,y]
                    if x==100 and y==100:
                        draw.line(l)
                        item+=1
                        l=[(128*item,512)]
                    else:
                        l.append((l[-1][0]+(100-x)*5,l[-1][1]+(100-y)*5))
    draw.line(l)
    newimg.save('black.jpg')

if __name__ == '__main__':
    main()
    
